using System.Web.Routing;
using Coderoom.ScrumPlanner.Tests.Unit.Internal;
using Coderoom.ScrumPlanner.Web;
using Coderoom.ScrumPlanner.Web.Controllers;
using MvcContrib.TestHelper;
using Xunit;

namespace Coderoom.ScrumPlanner.Tests.Unit.MvcTests
{
	public class ProjectControllerRouteTests
	{
		public ProjectControllerRouteTests()
		{
			RouteTable.Routes.Clear();
			MvcApplication.RegisterRoutes(RouteTable.Routes);
		}

		#region Project Controller

		[Fact]
		public void Can_Navigate_To___Project()
		{
			"~/Project".Route().MapsTo<ProjectController>(x => x.List());
		}

		[Fact]
		public void Can_Navigate_To___Project_List()
		{
			"~/Project/List".Route().MapsTo<ProjectController>(x => x.List());
		}

		[Fact]
		public void Can_Navigate_To___Project_New()
		{
			"~/Project/New".Route().MapsTo<ProjectController>(x => x.New());
		}

		[Fact]
		public void Can_Navigate_To___Project_New_with_parameters_Title_Slug()
		{
			"~/Project/New".Route().WithData(new { title = "title1", slug = "slug1" }).MapsTo<ProjectController>(x => x.New("title1", "slug1"));
		}

		[Fact]
		public void Can_Navigate_To___Project_Detail_with_parameter_Slug()
		{
			"~/Project/Detail".Route().WithData(new {slug = "project-a"}).MapsTo<ProjectController>(x => x.Detail("project-a"));
		}

		[Fact]
		public void Can_Navigate_To___Project_Delete_with_parameter_Slug()
		{
			"~/Project/Delete".Route().WithData(new { slug = "project-a" }).MapsTo<ProjectController>(x => x.Delete("project-a"));
		}

		#endregion

		//#region Theme Controller

		//[Fact]
		//public void MvcApplication_Can_Route_To___Themes()
		//{
		//    "~/Themes".Route().MapsTo<ThemeController>(x => x.List());
		//}

		//[Fact]
		//public void MvcApplication_Can_Route_To___Themes_List()
		//{
		//    "~/Themes/List".Route().MapsTo<ThemeController>(x => x.List());
		//}

		//#endregion

		//#region UserStory Controller

		//[Fact]
		//public void MvcApplication_Can_Route_To___UserStories()
		//{
		//    "~/UserStories".Route().MapsTo<UserStoryController>(x => x.List());
		//}

		//[Fact]
		//public void MvcApplication_Can_Route_To___UserStories_List()
		//{
		//    "~/UserStories/List".Route().MapsTo<UserStoryController>(x => x.List());
		//}

		//#endregion

		//#region Task Controller

		//[Fact]
		//public void MvcApplication_Can_Route_To___Tasks()
		//{
		//    "~/Tasks".Route().MapsTo<TaskController>(x => x.List());
		//}

		//[Fact]
		//public void MvcApplication_Can_Route_To___Tasks_List()
		//{
		//    "~/Tasks/List".Route().MapsTo<TaskController>(x => x.List());
		//}

		//#endregion

		//#region Sprint Controller

		//[Fact]
		//public void MvcApplication_Can_Route_To___Sprints()
		//{
		//    "~/Sprints".Route().MapsTo<SprintController>(x => x.List());
		//}

		//[Fact]
		//public void MvcApplication_Can_Route_To___Sprints_List()
		//{
		//    "~/Sprints/List".Route().MapsTo<SprintController>(x => x.List());
		//}

		//#endregion
	}
}